let Mock = require("mockjs")
let data = [
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b1.jpg"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b2.jpg"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b3.jpg"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b4.jpg"}
]

let cate = [
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(4).png",text:'改先几'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点'},
]

let xing = [
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点',title:'班特伦指令',price:"18"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点',title:'班特伦指令',price:"18"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点',title:'班特伦指令',price:"18"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点',title:'班特伦指令',price:"18"},
    {url:"http://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/category%20(2).png",text:'多输点',title:'班特伦指令',price:"18"},
]
Mock.mock("/api/home",'get',function(config){
    console.log(config)
    return data
})

Mock.mock(/\/api\/home\/\d/,'get',function(config){
    console.log(config)
    let arr = config.url.split('/')
    let id = arr.pop()
    console.log(id)
    if(id==1)return cate
    if(id==2)return xing
})
